package com.example.node.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

public class ProcessUtils {

    //获取主进程
    public static String getTopProcess(){
        File file=new File("/proc/"+android.os.Process.myPid()+"/cmdline");
        try {
            BufferedReader bf=new BufferedReader(new FileReader(file));
            String processName=bf.readLine().trim();
            bf.close();
            return processName;
        } catch (Exception e) {
            return null;
        }
    }
}
